PROJECT_NAME=dm
SRC_DIR=src
DIST_DIR=dist
FIGURES_DIR=figures

.PHONY: all clean

# use latex twice to create contents menu
all:
	-mkdir $(DIST_DIR)
	latex $(PROJECT_NAME).tex
	gbk2uni $(PROJECT_NAME)
	latex $(PROJECT_NAME).tex
	dvipdfmx -o $(DIST_DIR)/$(PROJECT_NAME).pdf $(PROJECT_NAME).dvi


clean:
	-rm -f $(SRC_DIR)/*.aux
	-rm -f $(DIST_DIR)/*
	-rmdir $(DIST_DIR)
	-rm -f $(PROJECT_NAME).dvi $(PROJECT_NAME).log $(PROJECT_NAME).toc $(PROJECT_NAME).aux 
	-rm -f $(PROJECT_NAME).out $(PROJECT_NAME).out.bak